<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">

<head>
    <!--
    Swim2 Theme - Ing. Software 2
    -->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Swim2</title>
	<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
	<style type="text/css">
	.art-post .layout-item-0 { padding-right: 10px;padding-left: 10px; padding-right: 10px;padding-left: 10px; }
   </style>
</head>

<body>

	<div id="art-page-background-glare-wrapper">
    <div id="art-page-background-glare"></div>
	</div>
<div id="art-main">
    <div class="cleared reset-box"></div>
    
<!--HEADER-->
<div class="art-header">
	<div class="art-header-position">
		<div class="art-header-wrapper">
        	<div class="cleared reset-box"></div>
            	<div class="art-header-inner">
                <div class="art-headerobject"></div>
                <div class="art-logo">
                    <h1 class="art-logo-name"><a href="./index.jsp">SWIM v2</a></h1>
                </div>
                </div>
    	</div>
	</div>
</div>
<div class="cleared reset-box"></div>
    
<!--NAVBAR-->    
<div class="art-bar art-nav">
<div class="art-nav-outer">
<div class="art-nav-wrapper">
<div class="art-nav-inner">
<!--Blocks Menu-->
<ul class="art-hmenu">
		<li>
		</li>
		<li>	
		</li>	
</ul>	
</div>
</div>
</div>
</div>
<div class="cleared reset-box"></div>

<!--BOX-->
<div class="art-box art-sheet">
	<div class="art-box-body art-sheet-body">
    	<div class="art-layout-wrapper">
        	<div class="art-content-layout">
            	<div class="art-content-layout-row">
                	<div class="art-layout-cell art-content">

<div class="art-box art-post">
<div class="art-box-body art-post-body">
<div class="art-post-inner art-article">
					<!--Titolo centrale-->	
                    <h2 class="art-postheader">Login:</h2>
                                                
<div class="art-postcontent">
<div class="art-content-layout">
<div class="art-content-layout-row">
<div class="art-layout-cell layout-item-0" style="width: 100%;">
    	<!--Contenuto principale-->
	
		<script type='text/javascript'>
		  
			function checkInput(username, password){

				var lost = 'LoginServlet?mail=';
				
				if(username.value.length == 0){
					alert("Username non deve essere vuoto");
					elem.focus();
				}
				else{

					lost = lost + username.value;
					lost = lost + '&password=';
					lost = lost + password.value;
					window.location = lost;					
				}
				
			}
			
		</script>
		<br>
		
			<table border="0" cellpadding="1" cellspacing="2" width="25%">

			<TBODY>
			<%
				if((Integer) request.getAttribute("login") == 0) {
					out.println("Credenziali errate, reinserisci mail e password");
				}
			%>
		<form method="post" action="Login.jsp">
			<tr>
			<td align="left" width="0%">Mail: </td>
			<td align="left" width="100%"><INPUT id="mail" name="mail" value=""></td>
			</tr>
			
			<tr>
			<td align="left" width="0%">Password: </td>
			<td align="left" width="100%"><INPUT id="password" name="password" type="password" value=""></td>
			</tr>
			
			<tr>
			<td align="left" width="0%"></td>
			<td align="left" width="50%"><input type="submit" value="submit"></td>
			</tr>		
			</form>	
			
			</TBODY>
			
			</table>
			
			<br>
			
			<a href="UserRegistration.jsp"><b>Registra un nuovo utente</b></a><br><br>
			
	<br>
	<form action="NameSearchResults.jsp" method="post">
	<h5>Cerca utente:</h5> <input id="namesearch" name="namesearch" type="" value="">
	<input id="userId" name="userId" type="hidden" value="-1">
	<input type="submit" value="Cerca">
	</form>
	
	
	<br/>
	<form action="AbilitySearchResults.jsp" method="post">
	<h5>Cerca utenti per abilità:</h5> 
	<select name="abilitysearch">
		<option>-- seleziona un'abilità --</option>
		
	<%
		ArrayList<String> s = (ArrayList<String>) request.getAttribute("allAbilities");
		for(int i=0; i < s.size(); i++) {
			
			out.println("<option id=\"abilitysearch\" name=\"abilitysearch\" type=\"\" value=\""+s.get(i)+"\">"+s.get(i)+"</option>");
		}
	%>
	</select>
	<input id="userId" name="userId" type="hidden" value="-1">
	<input id="friends" name="friends" type="hidden" value="0">
	<input type="submit" value="Cerca">
	</form>
	
			
<!--Fine contenuto principale-->
</div>
</div>
</div>
</div>
<div class="cleared"></div>
                
</div>
<div class="cleared"></div>
</div>
</div>
					<div class="cleared"></div>
                	</div>
            	</div>
        	</div>
    	</div>
    <div class="cleared"></div>
    <div class="cleared"></div>
	</div>
</div>
    
<br><br><br><br><br><br><br><br><br><br><br><br><br><br>

<!--FOOTER--> 
<div class="art-footer">
	<div class="art-footer-body">
    	<div class="art-footer-center">
        	<div class="art-footer-wrapper">
            	<div class="art-footer-text">
                	<p>Filippo Pellegrini - Alex Piermatteo - Matteo Tornielli</p>
                    <div class="cleared"></div>
                    <p class="art-page-footer">Swim v.2</p>
                </div>
            </div>
        </div>
        <div class="cleared"></div>
    </div>
</div>
<div class="cleared"></div>

<!--Fine main-->
</div>			
			
	
</body>
</html>